package cn.schoolwow.quickdao.module.database.dml.json.service.update;

import cn.schoolwow.quickdao.module.database.dml.json.flow.common.SetColumnNameListFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.common.check.CheckUniqueFieldNameFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.update.common.SetUpdateJSONObjectParameterFlow;
import cn.schoolwow.quickdao.module.database.dml.json.flow.update.common.SetUpdateJSONObjectStatementFlow;
import cn.schoolwow.quickdao.module.database.parent.flow.executor.ExecuteUpdateConnectionFlow;
import cn.schoolwow.quickflow.QuickFlowExecutor;
import cn.schoolwow.quickflow.flow.CompositeBusinessFlow;

public class UpdateJSONObjectCompositeBusiness implements CompositeBusinessFlow {
    @Override
    public void executeCompositeBusiness(QuickFlowExecutor quickFlowExecutor) {
        quickFlowExecutor.next(new CheckUniqueFieldNameFlow())
                .next(new SetColumnNameListFlow())
                .next(new SetUpdateJSONObjectStatementFlow())
                .next(new SetUpdateJSONObjectParameterFlow())
                .next(new ExecuteUpdateConnectionFlow())
                .putTemporaryData("name", "更新JSONObject");
    }

    @Override
    public String name() {
        return "更新JSONObject";
    }

}
